<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>20_函数参数高级-案例练习-如果传递的是2个参数就进行减法运算-如果传递是三个参数则求和</title>
    </head>
    <body>
        <script>
            function f1(){
                if(arguments.length == 2) {
                    console.log(arguments[0] - arguments[1]);
                }else if(arguments.length == 3) {
                    console.log(arguments[0] + arguments[1] + arguments[2]);
                }

            }

            f1(1,2);
            f1(1,2,3);
        </script>
    </body>
</html>